package pe.tnova.adra.kernel.gc;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import pe.tnova.adra.util.exception.KernelException;

@Component("MemoriaServer")
public class MemoriaServerImpl implements MemoriaServer {

	private static final Logger log = LoggerFactory.getLogger(MemoriaServerImpl.class);

	public void ejecutarLimpiador() throws KernelException {
	    System.out.println("ejecutarLimpiador");
	    System.out.println(log.isInfoEnabled());
	    System.out.println(log.isDebugEnabled());
	    System.out.println(log.isErrorEnabled());
	    System.out.println(log.isTraceEnabled());
	    System.out.println(log.isWarnEnabled());    
	    System.out.println("ejecutarLimpiadore");
		if (log.isDebugEnabled()) {
			log.debug("Ejecutando el GC del SO");
		}
		if (log.isInfoEnabled()) {
			log.info("Inicio el GC del SO");
		}
		System.gc();
		if (log.isDebugEnabled()) {
			log.debug("Termino el GC del SO");
		}
		if (log.isInfoEnabled()) {
			log.info("Fin el GC del SO");			
		}
	}

}
